﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Mysoft.MyCM.Web
{
	public class RouteConfig
	{
		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			// Summery Route
			routes.MapRoute(
				name: "Dashboard",
				url: "Dashboard/{cst}/{action}/{param}",
				defaults: new { controller = "Dashboard", action = "Index", cst = UrlParameter.Optional, param = UrlParameter.Optional }
			);

			// SCM Route
			routes.MapRoute(
				name: "SCM",
				url: "scm/{cst}/{action}/{param}",
				defaults: new { controller = "Scm", action = "Index", cst = UrlParameter.Optional, param = UrlParameter.Optional }
			);

			// CsCM Route
			routes.MapRoute(
				name: "CsCM",
				url: "CsCm/{cst}/{action}/{param}",
				defaults: new { controller = "CsCm", action = "Baseline", cst = UrlParameter.Optional, param = UrlParameter.Optional }
			);

			// RPTCM Route
			routes.MapRoute(
				name: "RptCM",
				url: "RptCM/{cst}/{action}/{param}",
				defaults: new { controller = "RptCM", action = "Index", cst = UrlParameter.Optional, param = UrlParameter.Optional }
			);

			// Error Route
			routes.MapRoute(
				name: "Error",
				url: "Error/{action}",
				defaults: new { controller = "Error", action = "Index" }
			);

			routes.MapRoute(
				name: "Default",
				url: "{controller}/{action}/{param}",
				defaults: new { controller = "Customer", action = "Switch", param = UrlParameter.Optional }
			);
		}
	}
}
